home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7699 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: nntp.teleport.com!usenet
  2. From: sconnors@teleport.com (Steve)
  3. Newsgroups: comp.lang.c
  4. Subject: New (but motivated) C user looking for help . . .
  5. Date: 28 Feb 1996 07:32:08 GMT
  6. Organization: Teleport - Portland's Public Access (503) 220-1016
  7. Message-ID: <4h10do$mqh@maureen.teleport.com>
  8. NNTP-Posting-Host: ip-pdx08-37.teleport.com
  9. Mime-Version: 1.0
  10. Content-Type: Text/Plain; charset=US-ASCII
  11. X-Newsreader: WinVN 0.99.7
  12.  
  13. Hello,
  14.  
  15. I'm trying to write a program that will gather an
  16. ip address, and a subnet mask typed in at the
  17. keyboard, and do a bitwise AND to view the result.
  18.  
  19. I am not lazy, and have been working on this for
  20. a while, but am kinda lost. I can prompt for and
  21. gather the input, but am at a loss to figure out
  22. the best way to deal with it.
  23.  
  24. First I thought I could bring the dotted octet in
  25. as an integer, but quickly found that I could not.
  26.  
  27. What I have done now is create char arrays for both
  28. the ip, and subnet. I planned to break the strings
  29. up and convert the fields between the periods back
  30. into (int ?) in order to do the AND.
  31.  
  32. I am rambling, but am I on the right track? If there
  33. is a better way; just a hint will do, I want to
  34. LEARN how to program, not copy someone elses work.
  35.  
  36. Please respond via e-mail to:
  37.  
  38. sconnors@teleport.com
  39.  
  40. Thanks!
  41.  
  42.